﻿using System;
using System.Collections.Generic;

namespace CivilRegistry.ControlledModel.Repository
{
    /// <summary>
    /// The finder interface.
    /// </summary>
    /// <typeparam name="TEntity">The entity.</typeparam>
    public interface IFinder<TEntity>
    {
        /// <summary>
        /// Finds the entity object by passed predicate.
        /// </summary>
        /// <param name="predicate">The predicate.</param>
        /// <returns>Found entity object, null if not found.</returns>
        TEntity FindBy(Func<TEntity, bool> predicate);

        /// <summary>
        /// Finds all entity objects of the type.
        /// </summary>
        /// <returns>Found entity objects, empty if none are found.</returns>
        List<TEntity> FindAll();
    }
}